/*
 * @Description: 权限先关接口
 * @rolesor: ZY
 * @Date: 2021-01-12 16:37:09
 * @LastEditors: ZY
 * @LastEditTime: 2021-01-13 16:50:20
 */

import https from '@/utils/https'
import { RequestParams } from 'axios-mapper'

export const getRoutes = () => {
  return https({
    url: 'roles/getRoutes',
    method: 'post'
  })
}

export const getRoles = () => {
  return https({
    url: 'roles/getRoles',
    method: 'get'
  })
}

export const delRole = (id: number) => {
  return https({
    url: 'roles/deleteRole',
    method: 'post',
    data: id
  })
}

export const updateRole = (id: number, data: any) => {
  return https({
    url: `roles/updateRole/${id}`,
    method: 'post',
    data: data
  })
}

export const createRole = (role: RequestParams) => {
  return https({
    url: 'roles/createRole',
    method: 'put',
    data: role
  })
}
